from django import template
register = template.Library()

@register.filter
def ul(value):
    if not isinstance(value, list): raise ValueError, "type <list> expected"
    result = "\n".join(map(lambda x: "".join(("\t<li>", x, "</li>")), value))
    return "<ul>\n%s</ul>\n\n" % result

ul.is_safe = True
